﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;

namespace TreeViewPicker
{
    public partial class OUPicker : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        [WebMethod]
        public static List<TreeNode> GetOrganisationalUnitsFor(string container)
        {
            var OUlist = new OrganisationUnitService().RetrieveOrganisationUnitFor(container);
            List<TreeNode> treeNodeList = TreeNodeList.CreateFrom(OUlist);
            return treeNodeList;
        }
    }
}